<%@ page language="java" import="java.util.*" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ include file="../include/taglib.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<%@ include file="../include/jsCss.jsp" %>
<title>角色信息</title>
<script>
	function roleDelete(id) {
		var dt = new Date();
		 $.ajax({
	           type: "POST",
	           url: "role!roleDelete.html", 
	           data: "roleId="+id+"&date="+dt,
	           success: function(data)
	           {
	           		if ($.trim(data) == 'success') {
	           			alert('删除成功');
	           			document.location.reload();
	           		}
	           }
	    });
	}
</script>

</head>

<body>
	<form action="role!roleList.html" method="post">
			<table border="1" width="100%">
				<tr>
					<th colspan="9"><h2>角色信息</h2>
					</th>
				</tr>
				<tr> 
					<td style="border:0px;">角色名：</td>
					<td style="border:0px;"><input type="text" name="roleName"/></td> 
					<td style="border:0px;"><input type="submit" value="搜索" /></td>
					<td  colspan="4" style="border: 0px;text-align: right;padding-right: 20px;">
					 	<a href="role!roleAdd.html">添加角色</a>
					</td>
				</tr>
				<tr>
					<td>编号</td>
					<td>角色名</td>
					<td>创建人</td>
					<td>创建时间</td>
					<td>备注</td>
					<td>状态</td>
					<td>操作</td>
				</tr>
				<s:iterator value="roleList" status="status">
					<tr>
						<td><s:property value="#status.Index+1" />
						</td>
						<td><s:property value="roleName" />
						</td>
						<td><s:property value="createUser" />
						</td>
						<td><s:property value="createTime" />
						</td>
						<td><s:property value="remark" />
						</td>
						<td>
							 <s:if test="status == 0">有效 </s:if>
						 	 <s:if test="status == 1">无效</s:if>
						</td> 
						<td>
							<a href="role!roleUpdate.html?roleId=<s:property value="roleId" />">修改 </a> |
							<a href="javascript:roleDelete(<s:property value="roleId" />)">删除</a> |
							<a href="role!roleAddPrivilege.html?roleId=<s:property value="roleId" />">绑定菜单权限</a> 
						</td>
					</tr>
				</s:iterator>
			</table>
			<div>
				<jsp:include page="../include/page.jsp"></jsp:include> 
			</div>
	</form>
</body>
</html>